package guice.action;

/**
 * 
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * @since 1.0
 * @version $Id$
 */
public class DefaultActionInvoker implements ActionInvoker {

	private ActionRegistry actionRegistry;

	public DefaultActionInvoker(ActionRegistry actionRegistry) {
		super();
		this.actionRegistry = actionRegistry;
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see guice.action.ActionInvoker#invoke(guice.action.Action)
	 */
	@Override
	public void invoke(Action action) throws ActionInvocationException {
		String name = action.name();
		try {
			Object result = actionRegistry.lookup(name);

		} catch (ActionNotFoundException e) {
			throw new ActionInvocationException(e);
		}
	}

}
